using System.Configuration;

namespace  Source.Web.FrameWork
{
    public class WebConfiguration : ConfigurationSection
    {
        private const string SECTION_NAME = "ola.config";

        public static WebConfiguration LoadConfiguration()
        {
            return ConfigurationManager.GetSection(SECTION_NAME) as WebConfiguration;
        }

        [ConfigurationProperty("HeaderPage", IsRequired = false)]
        public string HeaderPage
        {
            get
            {
                return (string)this["HeaderPage"];
            }
            set
            {
                this["HeaderPage"] = value;
            }
        }

        [ConfigurationProperty("ApplicationVersion", IsRequired = false, DefaultValue = "Not set")]
        public string ApplicationVersion
        {
            get
            {
                return (string)this["ApplicationVersion"];
            }
            set
            {
                this["ApplicationVersion"] = value;
            }
        }

        [ConfigurationProperty("ShowErrorDetails", IsRequired = false, DefaultValue = false)]
        public bool ShowErrorDetails
        {
            get
            {
                return (bool)this["ShowErrorDetails"];
            }
            set
            {
                this["ShowErrorDetails"] = value;
            }
        }

        [ConfigurationProperty("X500SearchPage", IsRequired = false)]
        public string X500SearchPage
        {
            get
            {
                return (string)this["X500SearchPage"];
            }
            set
            {
                this["X500SearchPage"] = value;
            }
        }

        [ConfigurationProperty("IsSsoEnabled", IsRequired = false, DefaultValue = false)]
        public bool IsSsoEnabled
        {
            get
            {
                return (bool)this["IsSsoEnabled"];
            }
            set
            {
                this["IsSsoEnabled"] = value;
            }
        }

        [ConfigurationProperty("SsoLoginUrl", IsRequired = false)]
        public string SsoLoginUrl
        {
            get
            {
                return (string)this["SsoLoginUrl"];
            }
            set
            {
                this["SsoLoginUrl"] = value;
            }
        }

        [ConfigurationProperty("SsoLogoutUrl", IsRequired = false)]
        public string SsoLogoutUrl
        {
            get
            {
                return (string)this["SsoLogoutUrl"];
            }
            set
            {
                this["SsoLogoutUrl"] = value;
            }
        }

        [ConfigurationProperty("SsoHeaderVariable", IsRequired = false)]
        public string SsoHeaderVariable
        {
            get
            {
                return (string)this["SsoHeaderVariable"];
            }
            set
            {
                this["SsoHeaderVariable"] = value;
            }
        }

        [ConfigurationProperty("HelpUrl", IsRequired = true)]
        public string HelpUrl
        {
            get
            {
                return (string) this["HelpUrl"];
            }
            set
            {
                this["HelpUrl"] = value;
            }
        }

        [ConfigurationProperty("HelpdeskUrl", IsRequired = true)]
        public string HelpdeskUrl
        {
            get
            {
                return (string)this["HelpdeskUrl"];
            }
            set
            {
                this["HelpdeskUrl"] = value;
            }
        }
    }
}